using System;
using System.Runtime.Serialization;

namespace SydEnergiPrototype.Model
{
    [DataContract]
    public class MarkedAddress : IAddress
    {
        [DataMember]
        public IAddress AlteredAddress;
        [DataMember]
        public IAddress OriginalAddress;
        
        public string StreetName
        {
            get { return AlteredAddress.StreetName; }
            set { AlteredAddress.StreetName = value; }
        }
        
        public int StreetNumber
        {
            get { return AlteredAddress.StreetNumber; }
            set { AlteredAddress.StreetNumber = value; }
        }
        
        public int ZipCode
        {
            get { return AlteredAddress.ZipCode; }
            set { AlteredAddress.ZipCode = value; }
        }
        
        public string City
        {
            get { return AlteredAddress.City; }
            set { AlteredAddress.City = value; }
        }
        
        public string Letter
        {
            get { return AlteredAddress.Letter; }
            set { AlteredAddress.Letter = value; }
        }
        
        public string Floor
        {
            get { return AlteredAddress.Floor; }
            set { AlteredAddress.Floor = value; }
        }

        public string StairCasePosition
        {
            get { return AlteredAddress.StairCasePosition; }
            set { AlteredAddress.StairCasePosition = value; }
        }

        public MarkedAddress(IAddress originaladdress, IAddress address)
        {
            if(address == null)
                throw new ArgumentNullException("address");
            AlteredAddress = address;

            if(originaladdress == null)
                throw new ArgumentNullException("originaladdress");
            OriginalAddress = originaladdress;
        }

        public override bool Equals(object obj)
        {
            return AlteredAddress.Equals(obj);
        }
    }
}